home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 October: Windmill on DISC / ADC Developer CD (1993-10) (''Windmill On DISC'')_iso / Dev.CD Oct 93.iso / Utilities / Installer v3.4.3 / Examples - Installer 3.4 / CustomOrder.r < prev    next >
Encoding:
Text File  |  1993-06-15  |  6.2 KB  |  168 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2.  *
  3.  *    Apple Macintosh Developer Technical Support
  4.  *
  5.  *  Installer 3.2 sample: setting package order in Custom Installation 
  6.  *
  7.  *    File:        CustomOrder.r -    Rez Source
  8.  *
  9.  *  Modifications:
  10.  *        5/19/93: RRK Changed Target file spec typeCrMustMatch flag setting to
  11.  *                        typeCrNeedNotMatch and included comment that this will
  12.  *                        allow the replacement of the target file if for some reason
  13.  *                        the file or creator are different.
  14.  *                     Used InstallerCommon.r defines.
  15.  *
  16.  *    by:            Jon Zap
  17.  *  updated for use with Installer 3.4 by: Rich Kubota 9/1/92
  18.  *
  19.  *    Copyright © 1991 Apple Computer, Inc.
  20.  *    All rights reserved.
  21.  *
  22.  *------------------------------------------------------------------------------
  23.  * This installation sample is intended to only demonstrate how to organize the
  24.  * entries in your Custom Installation screen.  All of the packages contain the
  25.  * same infa to simplify the script.  We are not recommending that you do this in
  26.  * a real script.  Points to notice:  the ordering is equivalent to the order
  27.  * in this file NOT on the resource ID number.  To look at it in another way, the
  28.  * ordering is the same as the REVERSE order that is seen when using resEdit.
  29.  * This example also demonstrates a divider package, which is used to provide
  30.  * you with the ability to group (or separate) packages in the list of packages
  31.  * on the custom installation screen.
  32.  * 
  33.  * For demonstration purposes so that you can try this script out, the script
  34.  * reference TeachText as the sample application which each inpk installs to the 
  35.  * "Installed Application:" folder on the target volume.
  36.  *----------------------------------------------------------------------------*/
  37.  
  38. #include "InstallerTypes.r"
  39. #include "InstallerCommon.r"        /* list of macros to simplify list */
  40.  
  41. /* You can build and complete the script with the following lines:
  42. # Note: set up floppies with the appropriate names and contents before running scriptcheck
  43. # or set up folders with the same names and contents as the floppies
  44. # put these folders in the same folder as the script or at the root directory of same disk
  45.  
  46.     rez -o "CustomOrder" -t 'bbkr' -c 'bbkr' "CustomOrder.r"
  47.     setfile -a i "CustomOrder"        #mark Inited
  48.     scriptcheck -p "CustomOrder"
  49. */
  50.  
  51. /* Definitions for the file spec atoms (specifications for source and destination files) */
  52. #define fsSourceProgram            2000
  53. #define fsTargetProgram            2001
  54.  
  55. /* This is the name of the source disk */
  56. #define ProgramDisk "Program Disk:"
  57.  
  58. /* This is the target path for where we want to install the file. */
  59. #define TargetPath    ":Installed Application:"
  60.  
  61. /* Definition for the package. */
  62. #define pkTheProgram1            3000
  63. #define pkTheProgram2            3001
  64. #define pkTheProgram3            3002
  65. #define pkTheProgram4            3003
  66. #define pkDivider1                1
  67.  
  68. /* Definition for the file atom */
  69. #define faProgram                4000
  70.  
  71. /***************************** Package Resources ************************************************/
  72. resource 'inpk' (pkTheProgram1) {
  73.     format0 {
  74.         showsOnCustom,             /* Package appears in the Custom Install display */
  75.         removable,                /* Package can be removed */
  76.         dontForceRestart,        /* installing an app doesnt require rebooting */
  77.         0,                         /* 'icmt' not required */
  78.         0,                        /* Package size (filled in by ScriptCheck) */
  79.         "First Package", {        /* package name */
  80.             'infa', faProgram;
  81.         }
  82.     }
  83. };
  84.  
  85. resource 'inpk' (pkTheProgram2) {
  86.     format0 {
  87.         showsOnCustom,             /* Package appears in the Custom Install display */
  88.         removable,                /* Package can be removed */
  89.         dontForceRestart,        /* installing an app doesnt require rebooting */
  90.         0,                         /* 'icmt' not required */
  91.         0,                        /* Package size (filled in by ScriptCheck) */
  92.         "Second Package", {        /* package name */
  93.             'infa', faProgram;
  94.         }
  95.     }
  96. };
  97.  
  98. resource 'inpk' (pkDivider1) {
  99.     format0 {
  100.         showsOnCustom,             /* Package appears in the Custom Install display */
  101.         notRemovable,            /* Package can't be removed */
  102.         dontForceRestart,        /* divider doesnt require rebooting */
  103.         0,                         /* 'icmt' not required */
  104.         0,                        /* Package size (filled in by ScriptCheck) */
  105.         "-", {'    ', 0 }        /* package name - divider */
  106.     }
  107. };
  108.  
  109. resource 'inpk' (pkTheProgram4) {
  110.     format0 {
  111.         showsOnCustom,             /* Package appears in the Custom Install display */
  112.         removable,                /* Package can be removed */
  113.         dontForceRestart,        /* installing an app doesnt require rebooting */
  114.         0,                         /* 'icmt' not required */
  115.         0,                        /* Package size (filled in by ScriptCheck) */
  116.         "First Additional Package", {        /* package name */
  117.             'infa', faProgram;
  118.         }
  119.     }
  120. };
  121. resource 'inpk' (pkTheProgram3) {
  122.     format0 {
  123.         showsOnCustom,             /* Package appears in the Custom Install display */
  124.         removable,                /* Package can be removed */
  125.         dontForceRestart,        /* installing an app doesnt require rebooting */
  126.         0,                         /* 'icmt' not required */
  127.         0,                        /* Package size (filled in by ScriptCheck) */
  128.         "Second Additional Package", {        /* package name */
  129.             'infa', faProgram;
  130.         }
  131.     }
  132. };
  133.  
  134. /********************************************* File Specs ***************************************/
  135. /* Source File Specs */
  136. resource 'infs' (fsSourceProgram) {
  137.     'APPL',                                /* File Type */
  138.     'ttxt',                                /* Creator */
  139.     kScriptCheckSetsDate,                /* ScriptCheck will fill in the creation date */
  140.     noSearchForFile,                    /* Do not search the source disk for the file */
  141.     typeCrMustMatch,                    /* file type and creator on this file must match */
  142.     ProgramDisk"TeachText"                /* Path to the file */
  143. };
  144.  
  145. /* Target File Specs */
  146. resource 'infs' (fsTargetProgram) {
  147.     'APPL',                                /* File Type */
  148.     'ttxt',                                /* Creator */
  149.     kNoDateStampCheck,                    /* creation date must be zero for target file spec */
  150.     noSearchForFile,                    /* Do not search the target disk for the file */
  151.     typeCrNeedNotMatch,                    /* file to be replaced even if F&C don't match  */
  152.     TargetPath"TeachText"                /* installation Path */
  153. };
  154.  
  155. /******************************************** File Atoms ************************************************/
  156. resource 'infa' (faProgram) {
  157.     format0 {
  158.         StdRemLeaveNewerCopy,            /* see InstallerCommon.r */
  159.         fsTargetProgram,                /* TARGET file spec */
  160.         fsSourceProgram,                 /* SOURCE file spec */
  161.         0,                                /* atom size (filled in by ScriptCheck) */
  162.         ""                                /* Atom Description (for a file Installer will use file name) */
  163.     };
  164. };
  165.  
  166.  
  167.  
  168.